#include <os/spinlock.h>
#include <os/atomic.h>


void spin_lock_init(struct spin_lock *lock)
{
    atomic_set(&lock->lock, 0);
}


void spin_lock(struct spin_lock *lock)
{
    while(atomic_read(&lock->lock));
    atomic_set(&lock->lock, 1);
}


void spin_unlock(struct spin_lock *lock)
{
    atomic_set(&lock->lock, 0);
}


void spin_lock_irq(struct spin_lock *lock)
{
    
}


void spin_unlock_irq(struct spin_lock *lock)
{

}


void spin_lock_irqsave(struct spin_lock *lock, unsigned long flags)
{

}


void spin_unlock_irqrestore(struct spin_lock *lock, unsigned long flags)
{

}


void spin_lock_destroy(struct spin_lock *lock)
{

}
